﻿using Microsoft.EntityFrameworkCore;

namespace Devonline.AspNetCore;

/// <summary>
/// 附件及文件操作类服务
/// </summary>
/// <typeparam name="TDbContext">数据库上下文</typeparam>
/// <typeparam name="TEntitySet">业务数据类型</typeparam>
/// <typeparam name="TAttachment">附件</typeparam>
/// <typeparam name="TKey">键类型</typeparam>
public interface IDataWithAttachmentService<TDbContext, TEntitySet, TAttachment, TKey> :
    IDataService<TDbContext, TEntitySet, TKey>
    where TDbContext : DbContext
    where TEntitySet : class, IEntitySet<TKey>
    where TAttachment : class, IAttachment<TKey>, new()
    where TKey : IConvertible
{ }

/// <summary>
/// 附件及文件操作类服务
/// 字符串作为主键的默认实现
/// </summary>
/// <typeparam name="TDbContext">数据库上下文</typeparam>
/// <typeparam name="TEntitySet">业务数据类型</typeparam>
public interface IDataWithAttachmentService<TDbContext, TEntitySet> :
    IDataWithAttachmentService<TDbContext, TEntitySet, Attachment, string>
    where TDbContext : DbContext
    where TEntitySet : class, IEntitySet<string>
{ }
